#!/bin/sh
###Operation servobj&&servgrp for test time

LIMIT=1024
OPER1=$1

add_service()
{
        for ((a = 1; a <= LIMIT; a++))
        do
		./servobj add leadsec$a 6 0-65536 0-65536
        done
}

del_service()
{
	
        for ((a = 1; a <= LIMIT; a++))
        do
		./servobj delete leadsec$a
        done
}

add_servgrp()
{
        ./servgrp -A internet -s dns0
        ./servgrp -A internet -s dns1
        ./servgrp -A internet -s http

        ./servgrp -A internet -s all_tcp
        ./servgrp -A internet -s all_udp
}

add_iptables()
{
        iptables -A FORWARD -m state --state ESTABLISHED -j ACCEPT
        iptables -A FORWARD -i eth2 -o eth0 -m servgrp --name internet -j ACCEPT
}

flush_iptables()
{
        iptables -F
        iptables -I INPUT -j ACCEPT
}

if [ $OPER1 = "flush" ]; then
	add_service
else
	del_service
fi
